use axum::routing::{delete, get};
use axum::{routing::post, Router};

use crate::bootstrap::AppState;
use crate::controller::user::shopping;

pub fn shoppingcart_router(state: &AppState) -> Router<AppState> {
    let router = Router::new()
        .route("/add", post(shopping::add)) // warn
        .route("/list", get(shopping::list))
        .route("/clean", delete(shopping::clean))
        .route("/sub", post(shopping::sub))
        .with_state(state.clone());

    router
}
